<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			this.setNavBarInfo()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData: {
		    navBarHeight: 0,     // 导航栏高度
		    menuBotton: 0,       // 胶囊距底部间距（保持底部间距一致）
		    menuRight: 0,        // 胶囊距右方间距（方保持左、右间距一致）
		    menuHeight: 0,       // 胶囊高度（自定义内容可与胶囊高度保证一致）
			menuTop:0
		},
		methods:{
			setNavBarInfo() {
			    // 获取系统信息
			    const systemInfo = wx.getSystemInfoSync();
			    // 胶囊按钮位置信息
			    const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
				console.log(menuButtonInfo);
			    // 导航栏高度 = 状态栏到胶囊的间距（胶囊距上距离-状态栏高度） * 2 + 胶囊高度 + 状态栏高度
			    this.globalData.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
				// 按钮位置
			    this.globalData.menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
			    this.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
			    this.globalData.menuHeight = menuButtonInfo.height;
				this.globalData.menuTop = menuButtonInfo.top;
				console.log(this.globalData.navBarHeight);
			 }
		}
	}
</script>

<style>
	/*每个页面公共css */
	.container {
		width: 100%;
		/* height: calc(100vh - 75px); */
		overflow: hidden;
		/* 底部安全距离 */
		/* padding-top: env(safe-area-inset-top);	 */
	}

	.container scroll-view {
		height: 100%;
	}

	.fixbg {
		width: 100%;
		height: 100vh;
		position: fixed;
		left: 0;
		top: 0;
		background-size: cover;
		background-position: center 0;
		filter: blur(20px);
		transform: scale(1.2);
	}
</style>
